home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11710 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  777 b 

  1. Path: nova.umuc.edu!not-for-mail
  2. From: srussell@nova.umuc.edu (Steve Russell)
  3. Newsgroups: comp.lang.c++
  4. Subject: random numbers
  5. Date: 15 Mar 1996 15:41:36 -0500
  6. Organization: University of Maryland University College
  7. Message-ID: <4ickm0$m8l@nova.umuc.edu>
  8. NNTP-Posting-Host: nova.umuc.edu
  9.  
  10. I just got a project from an instructor for what should be a
  11. simple program --- simulating the roll of the dice.  The whole
  12. thing is executing the stdlib.h function rand() ( rand()%6+1)
  13. to get a random number between 1 & 6.
  14.  
  15. The problem is I keep getting the *same* number.  I didn't
  16. read the library description, I don't have my book with me
  17. and it is a 45min walk home.  I assumed it was of type int
  18. and needed no inputs.
  19.  
  20. Does anybody know anything about this function?
  21.  
  22. Thanks
  23. Steve
  24.